<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>聊天页面</title>
    <link rel="stylesheet" href="css/chattest.css">
</head>

<body>
    <!-- 头部 -->
    <div id="head"></div>
    <!-- 主体 -->
    <div id="body">
        <!-- nav -->
        <div id="nav"></div>
        <!-- left -->
        <div id="left">
            <ul>
                <li>
                    <div id="Area">
                        <p>xxx的域</p>
                    </div>
                </li>
                <li>
                    <div id="id">
                        <p>ID:xxx</p>
                    </div>
                </li>
                <li>
                    <div class="chat">
                        <a href="#">文字聊天</a>
                    </div>
                </li>
                <li>
                    <div class="chat">
                        <a href="#">语音聊天</a>
                    </div>
                </li>
            </ul>
        </div>

        <div class="menu-popup" id="menuPopup">
            <div class="menu-item">
                <button onclick="showInviteModal()">邀请其他人</button>
            </div>
            <div class="menu-item">
                <button id="change-nickname-btn-popup">我在本域的昵称</button>
            </div>
            <div class="menu-item exit">
                <button id="exitBtn">退出域</button>
            </div>
        </div>

        <div class="popup-container" id="nickname-popup-container">
            <div class="popup">
                <h3>更改域昵称</h3>
                <input type="text" id="nickname-input" placeholder="望己">
                <div class="input-info">
                    <span id="nickname-length">2/10</span>
                </div>
                <div class="popup-buttons">
                    <button id="cancel-btn">取消</button>
                    <button id="save-btn">保存</button>
                </div>
            </div>
        </div>

        <div class="popup-container" id="exitPopup">
            <div class="popup">
                <h3>退出域</h3>
                <p>确定要退出 xxx的域？</p>
                <div class="popup-buttons">
                    <button id="cancelExitBtn">取消</button>
                    <button id="confirmExitBtn">退出域</button>
                </div>
            </div>
        </div>

        <div id="inviteModal" class="modal">
            <div class="modal-content">
                <span class="close">&times;</span>
                <h2>邀请用户进入</h2>
                <p>分享此链接，好友点击即可一键进入</p>
                <div class="link-container">
                    <input type="text" id="inviteLink" value="https://oopz.cn/i/Pe4F81" readonly>
                    <button onclick="copyLink()">复制邀请</button>
                </div>
            </div>
        </div>

        <!-- main -->
        <div id="main">
            <!-- 聊天框 -->
            <div id="chat-container">
                <ul id="chat-messages"></ul>
            </div>
            <!-- 输入栏 -->
            <div id="chat-input-container">
                <input type="text" id="chat-input" placeholder="输入消息...">
                <button id="send-button">发送</button>
            </div>
        </div>
        <!-- right -->
        <div id="right">
            <div id="member-list-container">
                <div id="search-container">
                    <input type="text" id="search-input" placeholder="搜索名称">
                    <button id="search-button">搜索</button>
                </div>
                <ul id="member-list">
                    <li>
                        <span class="status-online">在线(0)</span>
                    </li>
                    <li>
                        <span class="status-offline">离线(0)</span>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <script src="/socket.io/socket.io.js"></script>
    <script src="js/chattest.js"></script>
</body>

</html>